//
//  ESDataController.m
//  EasyStyle
//
//  Created by FK on 15/12/29.
//  Copyright © 2015年 FK. All rights reserved.
//

#import "ESDataController.h"

@implementation ESDataController

+ (instancetype)shareInstance
{
    static ESDataController *shareInstance = nil;
    static dispatch_once_t once;
    dispatch_once(&once,^{
        shareInstance = [[self alloc]init];
    });
    return shareInstance;
}


-(void)saveWeChatNewsPageNum:(NSNumber *)pageNum
{
    NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
//    [settings removeObjectForKey:@"WeChatNewsPageNum"];
    [settings setObject:pageNum forKey:@"WeChatNewsPageNum"];
    [settings synchronize];
}
-(NSNumber *)getWeChatNewsPageNum
{
    NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
    return [settings objectForKey:@"WeChatNewsPageNum"];
}


-(void)saveUserCityName:(NSString *)cityName
{
    NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
    [settings setObject:cityName forKey:@"UserCityName"];
    [settings synchronize];
}
-(NSString *)getUserCityName
{
    NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
    return [settings objectForKey:@"UserCityName"];
}


-(void)saveHoroscopeConsName:(NSString *)consName
{
    NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
    [settings setObject:consName forKey:@"HoroscopeConsName"];
    [settings synchronize];
}
-(NSString *)getHoroscopeConsName
{
    NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
    return [settings objectForKey:@"HoroscopeConsName"];
}


-(void)saveTrainStationFromCity:(NSString *)departCity andDestination:(NSString *)destinationCity
{
    NSDictionary *dict = @{@"departCity":departCity,@"destination":destinationCity};
    
    NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
    [settings setObject:dict forKey:@"TrainStationCity"];
    [settings synchronize];
}
-(NSDictionary *)getTrainStationCity
{
    NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
    return [settings objectForKey:@"TrainStationCity"];
}

//-(void)saveHoroscopeUpdateTime:(NSDate *)UpdateTime
//{
//    NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
//    [settings setObject:UpdateTime forKey:@"HoroscopeUpdateTime"];
//    [settings synchronize];
//}
//-(NSDate *)getHoroscopeUpdateTime
//{
//    NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
//    return [settings objectForKey:@"HoroscopeUpdateTime"];
//
//}
@end
